//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#ifndef __SERVICE_H__

#include <elasys_server.h>

EXTERN_C ECode CDECL ServiceRegister(
        /* [in]  */ PEMuid pClsId,
        /* [in]  */ PEIID pIid,
        /* [in]  */ UInt32 uIndex,
        /* [out] */ oid_t * pOid);

EXTERN_C ECode CDECL ServiceUnregister(
        /* [in]  */ oid_t oid);

EXTERN_C ECode CDECL ServiceRegisterCommon(
        /* [in]  */ WString serviceName,
        /* [in]  */ PEMuid pClsId,
        /* [in]  */ PEIID pIid,
        /* [in]  */ UInt32 uIndex,
        /* [out] */ oid_t * pOid);

EXTERN_C ECode CDECL ServiceUnregsiterCommon(
        /* [in]  */ WString serviceName);

EXTERN_C ECode CDECL ServiceResolveCommon(
        /* [in]  */ WString serviceName,
        /* [out] */ ProcessId * pProcessId,
        /* [out] */ EMuid * pClsId,
        /* [out] */ UInt32 * pUIndex,
        /* [out] */ oid_t * pOid);

EXTERN_C ECode CDECL AttachImportService(
        /* [in] */ oid_t oid);

EXTERN_C ECode CDECL DetachImportService(
        /* [in] */ oid_t oid);

EXTERN_C ECode CDECL ServiceGetChannelNameByOid(
        /* [in]  */ oid_t oid,
        /* [out] */ WStringBuf * name);

EXTERN_C ECode CDECL ServiceRegisterService(
        /* [in]  */ WString name,
        /* [in]  */ oid_t oid);

EXTERN_C ECode CDECL ServiceWaitService(
        /* [in]  */ WString name,
        /* [in]  */ Millisecond32 msTimeout,
        /* [out] */ WaitResult * pResult);

#endif
